package cn.webrx;

import java.util.HashMap;

public class HashMap3 {
    public static void main(String[] args) {
        HashMap<Integer, Student> hms = new HashMap<>();
        hms.put(100, new Student(101, "李四"));
        hms.put(200, new Student(202, "张三丰"));
        hms.put(300, new Student(303, "李四"));

        hms.forEach((a,b)-> System.out.println(b.getName()));

        hms.values().forEach(e->System.out.println(e.getName()));
        hms.values().forEach(System.out::println);

        //输出结果
        hms.keySet().forEach(System.out::println);
        hms.keySet().forEach(a->System.out.println(a));
    }
}
